/*
* @Author: wanghongfucoder
* @Date:   2017-04-11 10:52:02
* @Last Modified by:   wanghongfucoder
* @Last Modified time: 2017-04-11 10:57:28
*/

import java.util.ArrayList;
import java.util.List;
public class FilterChain {
	private  List<Filter> filters=new ArrayList<Filter>();
	private  Target target; 

	public void addFilter(Filter filter){
		filters.add(filter);
	}

	public void execute(String request){
		for (Filter filter : filters) {
			filter.execute(request);
		}
		target.execute(request);
	}

	public void setTarget(Target target){
		this.target=target;
	}
}